#!/bin/sh


mkdir ./output

let i=0

if [[ $1 -lt 101 ]] ; then
    while [ $i -lt $1 ]
    do
       if [[ $i -lt 10 ]] ; then
          index=0$i
       else
          index=$i
       fi

       echo "---> creating ./output/$index"
       mkdir ./output/$index

       let i++
    done
elif [[ $1 -lt 1001 ]] ; then
    while [ $i -lt $1 ]
    do
       if [[ $i -lt 10 ]] ; then
          index=00$i
       elif [[ $i -lt 100 ]] ; then
          index=0$i
       else
          index=$i
       fi

       echo "---> creating ./output/$index"
       mkdir ./output/$index

       let i++
    done
else
    echo "Unsupported number of replicas."
fi
